package weatherapp.network;

import java.io.*;
import java.net.*;
import java.nio.charset.StandardCharsets;

public class WeatherFetcher {
    public static String fetch(String urlString) throws IOException {
        URL url = new URL(urlString);
        HttpURLConnection conn = (HttpURLConnection) url.openConnection();
        conn.setRequestMethod("GET");
        InputStream input = conn.getInputStream();
        return new String(input.readAllBytes(), StandardCharsets.UTF_8);
    }
}
